<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            width: 2000px;
            height: 2000px;
        }

     
    </style>
</head>
<body>

    <script>

        document.onclick = function(e) {
            // clientX  距离视口的坐标
            console.log(e.clientX);
            // pageX   距离页面的实际的坐标
            console.log(e.pageX);

            console.log(e.x);   // 相当于 e.clientX 的简写
        }

    </script>
    
</body>
</html>